/**
 *
 */
package com.yangtao.prototype.system.domain;

import com.yangtao.framework.hibernate.BaseEntity;

import javax.persistence.*;
import java.util.List;

/**
 * @author 杨涛 页面元素对象
 */
@Entity
@Table(name = "sys_page_element")
public class PageElement extends BaseEntity {

	/**
	 *
	 */
	private static final long serialVersionUID = 1L;
	/**
	 * 元素所在的页面
	 */
	@ManyToOne(fetch = FetchType.LAZY, optional = false)
	@JoinColumn(name = "page_id")
	private Page page;
	/**
	 * 元素代码
	 */
	@Column(length = 10)
	private String code;
	/**
	 * 元素名称
	 */
	@Column(length = 30)
	private String name;
	/**
	 * 元素类型
	 */
	@Column(length = 2)
	private Integer type;
	/**
	 * 元素html标签名称
	 */
	@Column(length = 8)
	private String tagName;
	/**
	 * 元素样式
	 */
	@Column(length = 60)
	private String style;
	/**
	 * 元素css类
	 */
	@Column(length = 10)
	private String cssClass;
	/**
	 * 元素的资源文件key
	 */
	@Column(length = 10)
	private String i18nKey;
	/**
	 * 元素的值 一般值下拉单，如果为常量，这里是一个常量类型
	 */
	@Column(length = 200)
	private String value;
	/**
	 * 元素的取值url
	 */
	@Column(length = 20)
	private String vlaueUrl;
	/**
	 * 元素的javascript时间
	 */
	@Column(length = 20)
	private String event;
	/**
	 * 元素的javascript对象类型
	 */
	@Column(length = 20)
	private String jsType;

	@OneToMany(mappedBy = "element", fetch = FetchType.LAZY)
	private List<PageElementAuth> pea;

	/**
	 * @return the pea
	 */
	public List<PageElementAuth> getPea() {
		return pea;
	}

	/**
	 * @param pea the pea to set
	 */
	public void setPea(List<PageElementAuth> pea) {
		this.pea = pea;
	}

	/**
	 * @return the page
	 */
	public Page getPage() {
		return page;
	}

	/**
	 * @param page the page to set
	 */
	public void setPage(Page page) {
		this.page = page;
	}

	/**
	 * @return the code
	 */
	public String getCode() {
		return code;
	}

	/**
	 * @param code the code to set
	 */
	public void setCode(String code) {
		this.code = code;
	}

	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}

	/**
	 * @param name the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * @return the type
	 */
	public Integer getType() {
		return type;
	}

	/**
	 * @param type the type to set
	 */
	public void setType(Integer type) {
		this.type = type;
	}

	/**
	 * @return the tagName
	 */
	public String getTagName() {
		return tagName;
	}

	/**
	 * @param tagName the tagName to set
	 */
	public void setTagName(String tagName) {
		this.tagName = tagName;
	}

	/**
	 * @return the style
	 */
	public String getStyle() {
		return style;
	}

	/**
	 * @param style the style to set
	 */
	public void setStyle(String style) {
		this.style = style;
	}

	public String getCssClass() {
		return cssClass;
	}

	public void setCssClass(String cssClass) {
		this.cssClass = cssClass;
	}

	/**
	 * @return the i18nKey
	 */
	public String getI18nKey() {
		return i18nKey;
	}

	/**
	 * @param key the i18nKey to set
	 */
	public void setI18nKey(String key) {
		i18nKey = key;
	}

	/**
	 * @return the value
	 */
	public String getValue() {
		return value;
	}

	/**
	 * @param value the value to set
	 */
	public void setValue(String value) {
		this.value = value;
	}

	/**
	 * @return the vlaueUrl
	 */
	public String getVlaueUrl() {
		return vlaueUrl;
	}

	/**
	 * @param vlaueUrl the vlaueUrl to set
	 */
	public void setVlaueUrl(String vlaueUrl) {
		this.vlaueUrl = vlaueUrl;
	}

	/**
	 * @return the event
	 */
	public String getEvent() {
		return event;
	}

	/**
	 * @param event the event to set
	 */
	public void setEvent(String event) {
		this.event = event;
	}

	/**
	 * @return the jsType
	 */
	public String getJsType() {
		return jsType;
	}

	/**
	 * @param jsType the jsType to set
	 */
	public void setJsType(String jsType) {
		this.jsType = jsType;
	}
}
